home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / improv3a / setpassw.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-25  |  15.0 KB  |  359 lines

  1. VERSION 5.00
  2. Begin VB.Form setPassword 
  3.    Caption         =   "IvanSoft CompLock -- Set Password"
  4.    ClientHeight    =   1935
  5.    ClientLeft      =   5280
  6.    ClientTop       =   4770
  7.    ClientWidth     =   4575
  8.    Icon            =   "setPassword.frx":0000
  9.    LinkTopic       =   "setPassword"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   1935
  12.    ScaleWidth      =   4575
  13.    Begin VB.CommandButton cmdShrink 
  14.       Caption         =   "&Minimize to Systray"
  15.       Height          =   375
  16.       Left            =   1320
  17.       TabIndex        =   5
  18.       Top             =   840
  19.       Width           =   1935
  20.    End
  21.    Begin VB.CommandButton cmdQuit 
  22.       Caption         =   "E&xit"
  23.       Height          =   375
  24.       Left            =   3480
  25.       TabIndex        =   4
  26.       Top             =   840
  27.       Width           =   735
  28.    End
  29.    Begin VB.CheckBox chkSeePwd 
  30.       Caption         =   "&Show Me Password Before Locking Terminal"
  31.       Height          =   495
  32.       Left            =   360
  33.       TabIndex        =   3
  34.       Top             =   1320
  35.       Width           =   3975
  36.    End
  37.    Begin VB.CommandButton cmdOK 
  38.       Caption         =   "&OK"
  39.       Default         =   -1  'True
  40.       Enabled         =   0   'False
  41.       Height          =   375
  42.       Left            =   360
  43.       TabIndex        =   2
  44.       Top             =   840
  45.       Width           =   735
  46.    End
  47.    Begin VB.TextBox txtPassB 
  48.       Height          =   285
  49.       IMEMode         =   3  'DISABLE
  50.       Left            =   360
  51.       PasswordChar    =   "*"
  52.       TabIndex        =   1
  53.       Top             =   480
  54.       Width           =   3855
  55.    End
  56.    Begin VB.TextBox txtPassA 
  57.       Height          =   285
  58.       IMEMode         =   3  'DISABLE
  59.       Left            =   360
  60.       PasswordChar    =   "*"
  61.       TabIndex        =   0
  62.       Top             =   120
  63.       Width           =   3855
  64.    End
  65.    Begin VB.Menu mnu_1 
  66.       Caption         =   "&Systray Menu"
  67.       Visible         =   0   'False
  68.       Begin VB.Menu mPopRestore 
  69.          Caption         =   "&Restore"
  70.       End
  71.       Begin VB.Menu Sep1 
  72.          Caption         =   "-"
  73.       End
  74.       Begin VB.Menu mPopExit 
  75.          Caption         =   "E&xit"
  76.       End
  77.    End
  78. Attribute VB_Name = "setPassword"
  79. Attribute VB_GlobalNameSpace = False
  80. Attribute VB_Creatable = False
  81. Attribute VB_PredeclaredId = True
  82. Attribute VB_Exposed = False
  83.   Rem This Product made by IvanSoft
  84. '                       8888888888888
  85. '                  888888888888888888888888
  86. '               8888   8888888888888888888888888
  87. '             8888      8888888888888888888888888888
  88. '          88        888   8888888888888888888888888
  89. '        88888888    8           88888888888888888888
  90. '        888 8  888888                  88888888888   888
  91. '           88    88888888    m          88888888888    8
  92. '         888888888888888888 M           8888888888888
  93. '        88888888888888888888            M88888888888888
  94. '        8888888888888888888888         M8888888888888888
  95. '         8888888888888888888888       M888888888888888888
  96. '        8888888888888888  88888      M88888888888888888888
  97. '      88888888888888888   88888     M888888888888888   8888
  98. '     88888888888888888   88888    M  ;o*M*o;888888888    88
  99. '    88888888888888888   8888     M           88888888    8
  100. '   88888888888888888    88      M ;           888888888
  101. '  8888888888888888888   8      M  aAa        M8888888888       8
  102. '  88   8888888888  88    8    M             888888888888888 8888
  103. ' 88  88888888888   8         M          ;  88 88888888888888888
  104. ' 8  8888888888888           M  "@@@@@@@"    8w8888888888888888
  105. '  88888888888 888          M     "@a@"     M8i888888888888888
  106. ' 8888888888    88         M88             M88z88888888888888888
  107. '8888888888     8         M88888         MM888!888888888888888888
  108. '888888888     8         M8888888MAmmmAMVMM888*88888888   88888888
  109. '888888 M               M888888888       MM88888888888888   8888888
  110. '8888   M              M88888888888      MM888888888888888    88888
  111. ' 888   M             M8888888888888M     mM888888888888888    8888
  112. '  888  M            M8888 888888888888    m  Mm88888 888888   8888
  113. '   88  M            8888 88888888888888888      Mm8   88888   888
  114. '   88  M          8888M  88888  888888888888       Mm88888    88
  115. '   8   MM        8888M   8888     888888888888        Mm8     4
  116. '       8M       8888M     888       88   8888888        Mm    2
  117. '      88MM     8888M       88        8     888888   M     M
  118. '     8888M     888MM        8           M    8888    M    M
  119. '    88888M     88 M          8           M   8888      M  M
  120. '   88 888MM   888 M                       M 8888         M
  121. '   8 88888M   88  M                       MM 88            M
  122. '     88888M   88  M     CENSOREDCENSORED   M 88              M
  123. '    888888M   88  M     CENSOREDCENSORED   M  88              M
  124. '    888888MM  88  MM    CENSOREDCENSORED   M   8         CENSORED
  125. '    88888  M   8  MM    CENSOREDCENSORED   M             CENSORED
  126. '    8888   MM      MM                     MM             CENSORED
  127. '     888    M       MM                   MM  M           CENSORED
  128. '     888    MM       MMM                MM   MM               M
  129. '      88     M        MMMM           MMMM     MM            MM
  130. '       88    MM         MMMMMMMMMMMMMMM        MMM        MMM
  131. '        88    MM            MMMMMMM              MMMMMMMMMM
  132. '         88   8MM                                  MMMMMM
  133. '          8   88MM                      M   M        MM
  134. '             888MM                  MM      MM      MM
  135. '             88888MM               MMM       mM     MM
  136. '             888888MM             MMM         MMM   M
  137. '            88888888MM           MMM           MM   M
  138. '           88 8888888M         MMM              M   M
  139. '           8  888888 M       MM                 M   M
  140. '              888888 M      M                   M   MM
  141. '             888888  M     M                        M M
  142. '             888888  M     M         @              M  M
  143. '             88888   M              @@               M  M
  144. '            88888   M              @@@                M  M
  145. '           88888   M               @@                  M  M
  146. '          88888   M     m          @          Mm       M   M
  147. '          8888   M     M                       MM       M   M
  148. '         8888   M     M                       MMM        M   M
  149. '       888    M     Mm                      MMM         M    M
  150. '     8888    MM    Mm                     MMMM         m  m   M
  151. '     888      M     M                    MMM            M  mm   M
  152. '  8888       MM                         MM             mM  MM   M
  153. '             M                         M               mM  MM   Mm
  154. '            MM      m                                   M  MM   MM
  155. '            M        M                                   M  M   MM
  156. '           MM         M             M                     M M   MM
  157. '           M          CENSOREDCENSORED                     MM  MMM
  158. '           M          CENSOREDCENSORED                     MM  MM
  159. '           M          CENSOREDCENSORED                     M  MM
  160. '           M          CENSOREDCENSORED                    M  MM
  161. '           M          CENSOREDCENSORED                    M MM
  162. '           M          CENSOREDCENSORED                    MMM
  163. '           M                   M                          MMM
  164. '           MM                 M                          MMM
  165. '            M                 M                          MMM
  166. '            MM               M                          MMM
  167. '             M               M                         MMM
  168. '             MM             M                         MMM
  169. '              M             M                        MMM
  170. '              MM           M                        MMM
  171. '               M           M                       MMM
  172. '               MM         M                       MMM
  173. '                M         M                      MMM
  174. '                MM       M                      MMM
  175. '                 MM      M                     MMM
  176. '                 MM     M                     MMM
  177. '                  MM    M                    MMM
  178. '                  MM   M                    MMM
  179. '                   MM  M                   MMM
  180. '                   MM M                   MMM
  181. '                    MMM                  MMM
  182. '                    MM                  MMM
  183. '                     M                 MMM
  184. '                    MM                MMM
  185. '                    MM               MMM
  186. '                    MM    M         MMM
  187. '                    mMM    MM       MMMM
  188. '                     MMM           MMM M
  189. '                     mMM   M       M M M
  190. '                      MM  MMMM       M M
  191. '                      MM  MMM        M M
  192. '                      mMM  MM        M M
  193. '                       MM  MM         M M
  194. '                       MM  MM          M m
  195. '                       MM   M           MM
  196. '                       MMM               M
  197. '                       MMM               M
  198. '                       MMM                M
  199. '                       MMM                M
  200. '                       MMM                Mm
  201. '                        MM                MM
  202. '                        MMM               MM
  203. '                        MMM               MM
  204. '                        MMM               MM
  205. '                        MMM               MM
  206. '                         MM              MMM
  207. '                         MMM             MM
  208. '                         MMM             MM
  209. '                         MMM            MM
  210. '                          MM            MM
  211. '                          MM            MM
  212. '                          MM           MM
  213. '                          MMM          MM
  214. '                          MMM          MM
  215. '                           MM         MM
  216. '                           MMM        MM
  217. '                           MMM        MM
  218. '                            MM        MM
  219. '                            MMM      MM
  220. '                            MMM      MM
  221. '                             MM      MM
  222. '                             MM      MM
  223. '                              MM     MM
  224. '                              MM     MM
  225. '                              MM     M M
  226. '                              MM     M M
  227. '                               M      M
  228. '                             M M       M
  229. '                            M   M      M
  230. '                           M    M      M
  231. '                          M     M       M
  232. '                         M      MM       M
  233. '                         M       M        M
  234. '                         M; ;    M         M
  235. '                         M m ;   M          M
  236. '                         MM m m  M        ; M
  237. '                          MM m  MM       ; ;M
  238. '                           MM  MMM      ; m M
  239. '                            MMMM MM    m m MM
  240. '                                  MM    m MM
  241. '                                   MM    MM
  242. '                                    MM  MM
  243. '                                     M M
  244.   Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
  245.   Private Type NOTIFYICONDATA
  246.   cbSize As Long
  247.   hwnd As Long
  248.   uId As Long
  249.   uFlags As Long
  250.   uCallBackMessage As Long
  251.   hIcon As Long
  252.   szTip As String * 64
  253.   End Type    'constants required by Shell_NotifyIcon API call:
  254.   Const NIM_ADD = &H0
  255.   Const NIM_MODIFY = &H1
  256.   Const NIM_DELETE = &H2
  257.   Const NIF_MESSAGE = &H1
  258.   Const NIF_ICON = &H2
  259.   Const NIF_TIP = &H4
  260.   Const WM_MOUSEMOVE = &H200
  261.   Const WM_LBUTTONDOWN = &H201 'Button down
  262.   Const WM_LBUTTONUP = &H202 'Button up
  263.   Const WM_LBUTTONDBLCLK = &H203 'Double-click
  264.   Const WM_RBUTTONDOWN = &H204 'Button down
  265.   Const WM_RBUTTONUP = &H205 'Button up
  266.   Const WM_RBUTTONDBLCLK = &H206 'Double-click
  267. Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
  268. Private nid As NOTIFYICONDATA
  269. Private Sub cmdOK_Click()
  270. myPass = txtPassA.Text
  271. If chkSeePwd.Value = 1 Then
  272. MsgBox "Your Password is: " & myPass & "", vbInformation + vbMsgBoxSetForeground, "Your Password"
  273. Me.Hide
  274. frmLock.Show
  275. Me.Hide
  276. frmLock.Show
  277. End If
  278. End Sub
  279. Private Sub cmdQuit_Click()
  280. MsgBox "Thank You for using IvanSoft CompLock, Version " & App.Major & "." & App.Minor & "." & App.Revision & ""
  281. End Sub
  282. Private Sub cmdShrink_Click()
  283. Me.WindowState = vbMinimized
  284. End Sub
  285. Private Sub Form_Load()
  286.   Me.Show
  287.   Me.Refresh
  288.     With nid
  289.     .cbSize = Len(nid)
  290.     .hwnd = Me.hwnd
  291.     .uId = vbNull
  292.     .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
  293.     .uCallBackMessage = WM_MOUSEMOVE
  294.     .hIcon = Me.Icon
  295.     .szTip = " Click Right Mouse Button " & vbNullChar
  296.     End With
  297.     'If you want an icon always in the systray, do this: Shell_NotifyIcon NIM_ADD, nid
  298. End Sub
  299. Private Sub txtPassA_Change()
  300. If txtPassA.Text = txtPassB.Text Then
  301. cmdOK.Enabled = True
  302. cmdOK.Enabled = False
  303. End If
  304. End Sub
  305. Private Sub txtPassB_Change()
  306. If txtPassB.Text = txtPassA.Text Then
  307. cmdOK.Enabled = True
  308. cmdOK.Enabled = False
  309. End If
  310. End Sub
  311. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  312.     'This procedure receives the callbacks from the System Tray icon.
  313.     '
  314.     Dim Result As Long
  315.     Dim msg As Long    'The value of X will vary depending upon the scalemode setting
  316.     If Me.ScaleMode = vbPixels Then
  317.     msg = X
  318.     Else
  319.     msg = X / Screen.TwipsPerPixelX
  320.     End If
  321.     Select Case msg
  322.     'Case WM_LBUTTONUP '514 restore form window    Me.WindowState = vbNormal    Result = SetForegroundWindow(Me.hwnd)    Me.Show
  323.     Case WM_LBUTTONDBLCLK '515 restore form window
  324.     Me.WindowState = vbNormal
  325.     Result = SetForegroundWindow(Me.hwnd)
  326.     Me.Show
  327.     Case WM_RBUTTONUP
  328.     'Case WM_RBUTTONUP '517 display popup menu Result = SetForegroundWindow(Me.hwnd)        '***** STOP! and make sure that your first menu item
  329.         ' is named "mnu_1", otherwise you will get an erro below!!! *****
  330.         '     **
  331.         Me.PopupMenu Me.mnu_1
  332.         End Select
  333. End Sub
  334. Private Sub Form_Resize()
  335.     'this is necessary to assure that the minimized window is hidden
  336.     If Me.WindowState = vbMinimized Then
  337.     Shell_NotifyIcon NIM_ADD, nid
  338.     Me.Hide
  339.     Else
  340.     Me.Width = 4695
  341.     Me.Height = 2340
  342.     End If
  343.     End Sub
  344. Private Sub Form_Unload(Cancel As Integer)
  345.     'this removes the icon from the system tray
  346.     Shell_NotifyIcon NIM_DELETE, nid
  347.     MsgBox "Thank You for using IvanSoft CompLock, version " & App.Major & "." & App.Minor & "." & App.Revision & ""
  348.     End Sub
  349. Private Sub mPopExit_Click()
  350.     'called when user clicks the popup menu Exit command
  351.     Unload Me
  352.     End Sub
  353. Private Sub mPopRestore_Click()
  354.     'called when the user clicks the popup menu Restore command
  355.     Me.WindowState = vbNormal
  356.     Result = SetForegroundWindow(Me.hwnd)
  357.     Me.Show
  358.     End Sub
  359.